local Class = require('lua.lang.Class')

--- @class File : Class
--- @field pathname string
local File = Class {}

--- @constructor
--- @param pathname string
--- @return File
function File:new(pathname)
	--- @type File
	local o = {}
	o.pathname = pathname
	return setmetatable(o, File)
end

--- @return boolean
function File:exists()
	local f = io.open(self.pathname, 'r')
	local exists = f ~= nil
	if exists then
		f:close()
	end
	return exists
end

return File